package exsun.jt808.data.media.operate.util;

public class IdGenRtp {
    private volatile static IdGenRtp idGen808;

    private IdGenRtp()
    {
    }

    private int id = -1;

    public static IdGenRtp getSingleton()
    {
        if (idGen808 == null)
        {
            synchronized (IdGenRtp.class)
            {
                if (idGen808 == null)
                {
                    idGen808 = new IdGenRtp();
                }
            }
        }
        return idGen808;
    }

    public int genId()
    {
        if (id >= 0xffff)
        {
            id = id - 0xffff;
        }
        id = id + 1;
        return id;
    }

}
